package TestCode;


class Box {
    double length;
    double width;
    double height;

    //     设置初始值方法
    void setBox(int l, int w, int h) {
        length = l;
        width = w;
        height = h;
    }

    //     体积计算方法
    void volume() {
        System.out.println("长方体的体积是：" + (length * width * height));
    }

}


/**
 * @author GZQ
 * @Date 2023/12/28
 */
public class Test03 {
    public static void main(String[] args) {
        Box b = new Box();
        b.setBox(2, 4, 5);
        b.volume();
    }
}
